/*
 * Copyright (C) 2019-2020 Alibaba Group Holding Limited
 */

#include <board_config.h>
#include <yoc/partition.h>
#include <devices/devicelist.h>
#include <hci_hal_h4.h>

#include "app_main.h"
#include "app_init.h"

void board_yoc_init()
{
    board_init();
    console_init(CONSOLE_UART_IDX, 115200, 128);

    ulog_init();
#if (defined CONFIG_DEBUG) && (CONFIG_DEBUG)
    aos_set_log_level(AOS_LL_DEBUG);
#else
    aos_set_log_level(LOG_WARNING);
#endif

    LOGI(TAG, "Build:%s,%s", __DATE__, __TIME__);
    /* load partition */
    int ret = partition_init();
    if (ret <= 0) {
        LOGE(TAG, "partition init failed");
    } else {
        LOGI(TAG, "find %d partitions", ret);
    }

    aos_kv_init("kv");

    bt_TG7101C_register();
    extern int hci_h4_driver_init();
    hci_h4_driver_init();
    board_cli_init();
}
